package com.baizhiedu.factorybean;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * ClassName: StaticConnectionFactory
 * Description:
 * Date: 2022/11/20 PM 9:52:42
 * <p>
 * project: spring5
 * package: com.baizhiedu.factorybean
 * email: 1085844536@qq.com
 * version:
 *
 * @author WangGuojian
 */
public class StaticConnectionFactory {

    public static Connection getConnection() {
        Connection connection = null;
        try {
            Class.forName("java.sql.Driver");
            connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/wgj?useSSL=false", "root", "123456");
        } catch (SQLException | ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
        return connection;
    }
}
